import * as echarts from "../components/ec-canvas/echarts";

export function initChart(canvas, width, height, option) {
  const chart = echarts.init(canvas, null, {
    devicePixelRatio: 2,
    width: width,
    height: height,
    zlevel: -1, // 设置较低的层级
    z: -1, // 设置较低的层级
  });
  canvas.setChart(chart);
  chart.setOption(option);
  return chart;
}
